/*
 * SC_DUNGEON_CLEAR_LIST.cpp
 *
 *  Created on: 2013. 10. 18.
 *      Author: jjaehuny
 */


#include "../../Command.h"

#include "../../User.h"
#include "../../NLogic/Space.h"

namespace ProjectZ { namespace NCommand {

void Command::CS_DUNGEON_CLEAR_LIST(User * pUser, ::Network::Packet * pPacket)
{
	/*
	 * CS_DUNGEON_CLEAR_LIST				0x1122
	{
	}

	SC_DUNGEON_CLEAR_LIST				0x1123
	{
		// count 150 개 fix
		u8	isClear;					// 1 : clear, 0 : not clear
	}
	 */

	PREPARE_PACKET;

	if (NULL == pUser->GetSpace() )
	{
		DEBUGLOG("CS_DUNGEON_CLEAR_LIST NULL == pUser->GetSpace() || pUser->GetSpace()->GetData()._spaceType != NLogic::Space::SpaceType::WORLD");
		return;
	}

	::Network::Packet * pAck = ::Network::GETPACKETPOOL()->SEND_NEW();
	for (int i = 0; i < MAX_DUNGEON_COUNT; i++)
	{
		int nRetValue = 0;
		if (false == pUser->GetDungeonClearInfo().GetValue(i, nRetValue))
		{
			DEBUGLOG("ERROR %s index : %d GID : %d", __FUNCTION__, i, pUser->GetUserSeq());
		}

		* pAck << static_cast<uint8_t>(nRetValue);
	}
	pAck->MakePacket(CMD_SC_DUNGEON_CLEAR_LIST);
	pUser->Send(pAck);
}

} /*NCommand*/ } /*ProjectZ*/



